package com.sky.controller.user;

import com.sky.pojo.Category;
import com.sky.result.Result;
import com.sky.service.common.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * C端：分类控制器
 * @author zgp
 * @version V1.0
 * @date 2025-01-24 23:11
 */
@Slf4j
@Api(tags = "分类相关接口")
@RestController("userCategoryController")
@RequestMapping("/user/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @ApiOperation("查询启用状态分类")
    @GetMapping("/list")
    public Result<List<Category>> getCategoryList(){
        log.info("查询启用状态分类数据.");
        List<Category> categories = categoryService.getEnableStatusCategorys();
        return Result.success(categories);
    }
}
